/* eslint-disable eol-last */
/* eslint-disable indent */
'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
    const { router, controller } = app;
    router.get('/', app.middleware.loginChecks.loginCheck, controller.home.index);
    // 用户信息
    router.get('/setting/:userName', controller.home.settingPage);
    // 加载更多
    router.get('/loadingMore/:userName/:pageIndex', controller.home.loadingMore);
    // 引入页面
    require('./routes/pages/user')(app);
    require('./routes/pages/atMe')(app);
    require('./routes/pages/profile')(app);
    // 引入api
    require('./routes/apis/user')(app);
    require('./routes/apis/upload')(app);
    require('./routes/apis/blog')(app);
    require('./routes/pages/profile')(app);
    require('./routes/apis/profile')(app);
    // router.get('/setting/:userName', controller.home.settingPage);
    // 404
    router.get('*', controller.home.notFound);
};